#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    char characters[20];
    while (cin >> characters)
    {
        int count = 1, total = 0;
        int n = strlen(characters);
        for (int i = 0; i < n - 2; i++)
        {
            int cur = characters[i] - '0';
            if (cur <= 9 && cur >= 0)
            {
                total += cur * count++;
            }
        }
        total = total % 11;
        char target;
        if (total == 10)
            target = 'X';
        else
            target = total + '0';
        if(characters[n - 1] == target)
            cout << "Right" << endl;
        else 
        {
            characters[n - 1] = target;
            cout << characters << endl;
        }

    }
    return 0;
}